home *** CD-ROM | disk | FTP | other *** search
Wrap
public class MultiPivotDoor extends Codex { private int _frameNum = 1; private float _duration = 3.0F; private CodexThing _door = new CodexThing(((Codex)this).GetClassThing()); private CodexThing _door2; private CodexThing _door3; private CodexThing _door4; private CodexThing _door5; private CodexThing _door6; private CodexThing _door7; private CodexThing _door8; private int _OpenOnce; private int _AllowClicked = 1; private boolean bOpen; private boolean bActive; public static String[] _params = new String[]{"Rotate around frame;1", "Duration;3.0", "Open Once;0", "Allow clicked event; 1", "Second part of door", "Third part of door", "Fourth part of door", "Fifth part of door", "Sixth part of door", "Seventh part of door", "Eighth part of door"}; public void clicked(int guid, int clickerGuid, int captureId) { if (this._AllowClicked == 1) { this.MoveParts(); } } public void beginscene(int clientGuid, int captureID) { this._door.SetThingFlags(8192); this._door2.SetThingFlags(8192); this._door3.SetThingFlags(8192); this._door4.SetThingFlags(8192); this._door5.SetThingFlags(8192); this._door6.SetThingFlags(8192); this._door7.SetThingFlags(8192); this._door8.SetThingFlags(8192); } public void arrived(int thingGuid, int frameNum, int captureId) { if (this._OpenOnce == 0) { this.bActive = false; } else { this._door.SetCollideType(0); this._door2.SetCollideType(0); this._door3.SetCollideType(0); this._door4.SetCollideType(0); this._door5.SetCollideType(0); this._door6.SetCollideType(0); this._door7.SetCollideType(0); this._door8.SetCollideType(0); this._door.SetThingFlags(64); this._door2.SetThingFlags(64); this._door3.SetThingFlags(64); this._door4.SetThingFlags(64); this._door5.SetThingFlags(64); this._door6.SetThingFlags(64); this._door7.SetThingFlags(64); this._door8.SetThingFlags(64); } } public void restore(int flags) { this.bOpen = CodexSequence.RestoreBoolean(); } public void MoveParts() { if (!this.bActive) { this.bActive = true; if (!this.bOpen) { this._door.RotatePivot(this._frameNum, this._duration); this._door2.RotatePivot(this._frameNum, this._duration); this._door3.RotatePivot(this._frameNum, this._duration); this._door4.RotatePivot(this._frameNum, this._duration); this._door5.RotatePivot(this._frameNum, this._duration); this._door6.RotatePivot(this._frameNum, this._duration); this._door7.RotatePivot(this._frameNum, this._duration); this._door8.RotatePivot(this._frameNum, this._duration); this.bOpen = true; } else { this._door.RotatePivot(this._frameNum, -this._duration); this._door2.RotatePivot(this._frameNum, -this._duration); this._door3.RotatePivot(this._frameNum, -this._duration); this._door4.RotatePivot(this._frameNum, -this._duration); this._door5.RotatePivot(this._frameNum, -this._duration); this._door6.RotatePivot(this._frameNum, -this._duration); this._door7.RotatePivot(this._frameNum, -this._duration); this._door8.RotatePivot(this._frameNum, -this._duration); this.bOpen = false; } } } public void triggered(int triggeredGUID, int triggererGUID, int triggerID, float p0, float p1, float p2, float p3, int captureID) { this.MoveParts(); } public MultiPivotDoor(int frameNum, float duration, int OpenOnce, int AllowClicked, CodexThing door2, CodexThing door3, CodexThing door4, CodexThing door5, CodexThing door6, CodexThing door7, CodexThing door8) { this._door.SetDescriptionID("GEN_DOOR"); this._frameNum = frameNum; this._duration = duration; this._OpenOnce = OpenOnce; this._AllowClicked = AllowClicked; this._door2 = new CodexThing(((Codex)door2).GetGUID()); if (this._door2.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door2.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door2.GetGUID()); this._door3 = new CodexThing(((Codex)door3).GetGUID()); if (this._door3.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door3.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door3.GetGUID()); this._door4 = new CodexThing(((Codex)door4).GetGUID()); if (this._door4.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door4.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door4.GetGUID()); this._door5 = new CodexThing(((Codex)door5).GetGUID()); if (this._door5.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door5.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door5.GetGUID()); this._door6 = new CodexThing(((Codex)door6).GetGUID()); if (this._door6.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door6.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door6.GetGUID()); this._door7 = new CodexThing(((Codex)door7).GetGUID()); if (this._door7.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door7.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door7.GetGUID()); this._door8 = new CodexThing(((Codex)door8).GetGUID()); if (this._door8.GetDescriptionID().equalsIgnoreCase("PROP")) { this._door8.SetDescriptionID("GEN_DOOR"); } ((Codex)this).CaptureThing(this._door8.GetGUID()); } public void save(int flags) { CodexSequence.SaveBoolean(this.bOpen); } }